const path = require('path');
function resolve (dir) {
    return path.join(__dirname, dir)
}
//配置文件夹的别名
module.exports = {
    lintOnSave: true,
    // 生成文件的上级目录
    baseUrl: '/traver',
    chainWebpack: (config)=>{
        config.resolve.alias
            // .set('@$', resolve('src'))
            .set('styles',resolve('src/assets/styles'))
            .set('common',resolve('src/assets/common'))
            // .set('assets',resolve('src/assets'))
            // .set('components',resolve('src/components'))
            // .set('layout',resolve('src/layout'))
            // .set('base',resolve('src/base'))
            // .set('static',resolve('src/static'))
    },
    devServer: {
        proxy: {
            //重定向连接
            '/api': {
                target: 'http://localhost:8080',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                  '^/api': '/mock'
                }
            }
         }
    }

}
